if exists (select 1
   from dbo.sysreferences r join dbo.sysobjects o on (o.id = r.constid and o.type = 'F')
   where r.fkeyid = object_id('Admin_Roles_Func') and o.name = 'FK_ADMIN_RO_REFERENCE_ADMIN_RO')
alter table Admin_Roles_Func
   drop constraint FK_ADMIN_RO_REFERENCE_ADMIN_RO
go

if exists (select 1
            from  sysobjects
           where  id = object_id('Admin_Roles_Func_Template')
            and   type = 'U')
   drop table Admin_Roles_Func_Template
go

/*==============================================================*/
/* Table: Admin_Roles_Func_Template                             */
/*==============================================================*/
create table Admin_Roles_Func_Template (
   FuncCode             varchar(20)          not null,
   FuncName             varchar(20)          null,
   Remark               varchar(255)         null,
   CreateDate           Date             null,
   CreateId             char(36)             null,
   UpdateId             char(36)             null,
   UpdateDate           Date             null,
   RowVerNo             timestamp            null,
   constraint PK_ADMIN_ROLES_FUNC_TEMPLATE primary key (FuncCode)
)
go
